#include <iostream>

int main(int argc, char *argv[])
{
  int i = 0, &r = i;
  auto a = r;

  const int ci = i, &cr = ci;
  auto b = ci;
  auto c = cr;
  auto d = &i;
  auto e = &ci;

  const auto f = ci;

  auto &g = ci;
  // auto &h = 42;
  const auto &j = 42;

  auto k = ci, &l = i;
  auto &m = ci, *p = &ci;
  // auto &n = i, *p2 = &ci;

  // 2.33
  a = 42;  // ok
  b = 42;  // ok top-const 丢失
  c = 42;  // ok 同上
  // d = 42;  // error d is a pointer
  // e = 42;  // error pointer to const
  // g = 42;  // error refs to const
  std::cout << "a" << a << "b" << b << "c" << c << "d" << d << "e" << e << "g" << g << std::endl;

  return 0;
}
